/**
 * 专窗办理中-材料出库的js  api
 * chengcheng
 *
 */

import request from "@/utils/request";

/**
 * 办件受理成功时，插入数据到材料出库表中
 * @param {*} caseOid
 */
export function acceptanceInsertMaterialsOutStored(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/zcbl/materialsOutStored/acceptanceInsertMaterialsOutStored/${caseOid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

/**
 * 分页查询材料出库数据
 * @param {*} params
 */
export function queryPages(params) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/materialsOutStored/queryPages",
    method: "get",
    params: params
  });
}

/**
 * 根据id查询材料出库的数据
 * @param {*} id
 */
export function getByIdMaterialsOutStored(id) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/zcbl/materialsOutStored/getById/${id}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

/**
 * 根据id查询材料出库的数据
 * @param {*} caseOid
 */
export function getBycaseOid(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/materialsOutStored/getBycaseOid?caseOid=" +
      caseOid,
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}
/**
 * 材料出库保存操作
 * @param {*} data
 */
export function saveOrUpdateMaterialsOutStoredInfo(data) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/zcbl/materialsOutStoredInfo/saveOrUpdate`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}

/**
 * 根据办件编号查询未出库的数据
 * @param {*} caseNumber
 */
export function queryByCaseNumber(caseNumber) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/zcbl/materialsOutStored/queryByCaseNumber/${caseNumber}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

/**
 * 根据MOSOid查询materialsOutStoredInfo对象数据
 * @param {*} mosOid
 */
export function queryByMosOid(mosOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/zcbl/materialsOutStoredInfo/queryByMosOid/${mosOid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

/**
 * 根据caseOid查询出库信息
 * @param {*} caseOid
 * @returns
 */
export function queryListByCaseOid(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/zcbl/materialsOutStored/queryListByCaseOid/${caseOid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

/**
 * 根据id查询材料出库的数据
 * @param {*} caseOid
 */
export function getAddresseeList() {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH + `/yxpz/addressee/getAddresseeList`,
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}
